/*
 * @Author: czy
 * @Date: 2021-07-09 14:04:39
 * @LastEditTime: 2021-07-13 22:46:42
 */
#include "lib/meminfo.h"
#include "lib/partition.h"

#include "sys/config.h"
#include "sys/system.h"

unsigned int KMEMHandler = 0;
unsigned int UMEMHandler = 0;
unsigned int heapSize = 0;

/**
 * @description: Initialization.
 */
void memory_init(void)
{
    unsigned int memStart = getMemStart();
    unsigned int memSize = getMemSize();
    heapSize = memSize / (MEM_BLOCK + 1);
    KMEMHandler = dPartitionInit(memStart, heapSize);
    UMEMHandler = eFPartitionInit(memStart + heapSize * 1.2, heapSize, MEM_BLOCK - 1);
}